﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Manager/Base.Master" AutoEventWireup="true" CodeBehind="Project.aspx.cs" Inherits="YXQ.Manager.Manager.Project" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <table class="tbs_table">
        <tr>
            <td class="tdtitle" align="left">
                项目名称
            </td>
            <td align="left" class="tdtitle">
                <input type="text" id="txtProjectName"   runat="server"  style="width:400px;"  class="text"/>
            </td>
            </tr>
        <tr>
            <td align="left" class="tdtitle">
                开工时间
            </td>
            <td align="left" class="tdtitle">
                <input type="text" id="txtStartTime" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})"   class="text" runat="server"/>
            </td>
             </tr>
        <tr>
            <td align="left" class="tdtitle">
                完工时间
            </td>
            <td align="left" class="tdtitle">
                <input type="text" id="txtEndTime" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})"   class="text" runat="server"/>
            </td>
             </tr>
        <tr>
            <td align="left" class="tdtitle" colspan="2">
                <input type="button" id="btnSave" value="保存" class="bt_wb1"  onclick="SavePro();"/>
            </td>
        </tr>
    </table>

    <script type="text/javascript">

        function SavePro() {

            var pName = $("#<%=txtProjectName.ClientID%>").val();
            var startTime = $("#<%=txtStartTime.ClientID%>").val();
            var endTime = $("#<%=txtEndTime.ClientID%>").val();
            if(pName==""){
                YXQ.Common.Message("对不起，请输入工程名称！");
                return;
            }
            //if(startTime==""){
            //    YXQ.Common.Message("对不起，请输入开始时间！");
            //    return;
            //} 
            //if(endTime==""){
            //    YXQ.Common.Message("对不起，请输入结束时间！");
            //    return;
            //}


            var obj = {};
            obj.Id=<%=reqID%>
            obj.ProjectName = pName;
            obj.StartTime = startTime;
            obj.EndTime = endTime;
            obj.Tpid=<%=tpid %>;
            obj.OrderId=0;
            YXQCore.Form.PostData("../Handler/CommonHandler.ashx",
                                    { PostData:$.toJSON(obj),OpType:"SavePro" },
                                    function (e) {
                                        if (e.ResultMessage == "Success") {
                                            YXQ.Common.Message("保存成功！"); 
                                            
                                        } else {
                                            YXQ.Common.Message("保存失败！");
                                            return;
                                        }
                                        YXQ.Manager.CloseDialog();
                                    });

        }
    
    </script>
</asp:Content>
